<?

session_start();

if($access)

{

header("Content-type: text/javascript");

?>

function myFunction()
{
var x="";
var time=new Date().getHours();
if (time<20)
  {
  x="Good day";
  }
else
  {
  x="Good evening";
  }
document.getElementById("demo").innerHTML=x;
}

alert("Access Reserved");

<?

$access = false;

}

?>